package com.autumn.mybatis.criterion;

/**
 * 条件运算符
 * 
 * @author 老码农
 *
 *         2017-10-26 10:53:45
 */
public enum CriteriaOperatorEnum {
	/**
	 * 等于
	 */
	EQ("=", true),
	/**
	 * 非等于
	 */
	NOT_EQ("<>", true),
	/**
	 * 大于
	 */
	GT(">", true),
	/**
	 * 大于等于
	 */
	GE(">=", true),
	/**
	 * 小于
	 */
	LT("<", true),
	/**
	 * 小于等于
	 */
	LE("<=", true),

	/**
	 * like '%value%'
	 */
	LIKE("LIKE", false),
	/**
	 * 左like 'value%'
	 */
	LEFT_LIKE("LEFT_LIKE", false),
	/**
	 * 右like '%value'
	 */
	RIGHT_LIKE("RIGHT_LIKE", false),

	/**
	 * between (1 and 2)
	 */
	BETWEEN("BETWEEN", false);	

	private final String operator;
	private final boolean isSimple;

	/**
	 * 
	 * @param operator
	 * @param isSimple
	 */
	private CriteriaOperatorEnum(String operator, boolean isSimple) {
		this.operator = operator;
		this.isSimple = isSimple;
	}

	/**
	 * 获取运算符
	 * 
	 * @return
	 */
	public String getOperator() {
		return operator;
	}

	/**
	 * 获取是否为简单表达式
	 * 
	 * @return
	 */
	public boolean isSimple() {
		return isSimple;
	}
}
